package com.gjun.struts.action;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

public class SystemUserLogoutAction {
    public String execute(){
    	ServletActionContext.getRequest().getSession().invalidate();
    	try {
    		//System.out.println("安全离开系统");
    		HttpServletResponse response = ServletActionContext.getResponse();
//    		response.setHeader("Cache-Control","no-cache"); //Forces caches to obtain a new copy of the page from the origin server
//    		response.setHeader("Cache-Control","no-store"); //Directs caches not to store the page under any circumstance
//    		response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
//    		response.setHeader("Pragma","no-cache"); 
    		
    		
    		response.
			sendRedirect(ServletActionContext.getRequest().getContextPath()+"/signin.jsp");
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	return null;
    }
}
